<% %>
 <span id='indicator' style="float:right;margin-right:20%;display:none;">
    <%=image_tag"indicator.gif"%>
 </span>
<div class='extra-nav'>
  <ul>
    <li <%="class=active" if controller.action_name == 'success'%>>
	    <%=link_to_remote 'Active Projects'.t + " (" + session[:user].active_projects.size.to_s + ")",
	                      :update=>'projects',
	                      :loading =>"Element.show('indicator')",
	                      :complete=>"Element.hide('indicator')",
						  :url=>{:controller=>controller.controller_name,:action=>'success'}
	    %></li>
    <li <%="class=active" if controller.action_name == 'show_completed_projects'%>>
	    <%=link_to_remote 'Completed Projects'.t + " (" + session[:user].completed_projects.size.to_s + ")",
	                      :update=>'projects',
	                      :loading =>"Element.show('indicator')",
	                      :complete=>"Element.hide('indicator')",
						  :url=>{:controller=>controller.controller_name,:action=>'show_completed_projects'}
	    %></li>
    <li <%="class=active" if controller.action_name == 'show_all_projects'%>>
        <%=link_to_remote 'All Projects'.t + " (" + session[:user].projects.size.to_s + ")",
	                      :update=>'projects',
	                      :loading =>"Element.show('indicator')",
	                      :complete=>"Element.hide('indicator')",
						  :url=>{:controller=>controller.controller_name,:action=>'show_all_projects'}
	    %></li>
  </ul>
</div>
<table class=TimeTrack>
<tr align=left height=20>
  <th><%="Project Name".t%></th>
  <th><%="My hours".t%></th>
  <th><%="Total hours".t%></th>
  <th><%="Customer".t%></th>
  <th><%="General info".t%></th>
</tr>
<%
  my_hour =0
  total_hour =0
%>
<%@projects.each do |p|%>
<%%>
<tr>
  <td><%=link_to p.name,:controller=>'project',:action=>'show',:id=>p.id%> </td>
  <td><%=sprintf('%0.2f',(h = p.hours(session[:user].id))) %></td>
  <td><%=sprintf('%0.2f',(t = p.total_hours))%></td> 
  <td><%=p.customer%></td> 
  <td><%=p.general_info%></td> 
</tr>
<%
  my_hour += h 
  total_hour += t 
%>
<%end%>
<tr class=th>
   <td> <%="Hours sum".t%> </td>
   <td> <%=sprintf('%0.2f',my_hour)%> </td>
   <td> <%=sprintf('%0.2f',total_hour)%> </td>
   <td colspan=2> </td>
</tr>
</table>
